home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / dos / exall.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  3KB  |  110 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: exall.c,v 1.5 1996/10/24 15:50:27 aros Exp $
  4.     $Log: exall.c,v $
  5.     Revision 1.5  1996/10/24 15:50:27  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/09/13 17:50:06  digulla
  9.     Use IPTR
  10.  
  11.     Revision 1.3  1996/08/13 13:52:45  digulla
  12.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  13.     Replaced AROS_LA by AROS_LHA
  14.  
  15.     Revision 1.2  1996/08/01 17:40:50  digulla
  16.     Added standard header for all files
  17.  
  18.     Desc:
  19.     Lang: english
  20. */
  21. #include <exec/memory.h>
  22. #include <clib/exec_protos.h>
  23. #include <dos/filesystem.h>
  24. #include <dos/exall.h>
  25. #include "dos_intern.h"
  26.  
  27. /*****************************************************************************
  28.  
  29.     NAME */
  30.     #include <clib/dos_protos.h>
  31.  
  32.     AROS_LH5(BOOL, ExAll,
  33.  
  34. /*  SYNOPSIS */
  35.     AROS_LHA(BPTR,                  lock,    D1),
  36.     AROS_LHA(struct ExAllData *,    buffer,  D2),
  37.     AROS_LHA(LONG,                  size,    D3),
  38.     AROS_LHA(LONG,                  data,    D4),
  39.     AROS_LHA(struct ExAllControl *, control, D5),
  40.  
  41. /*  LOCATION */
  42.     struct DosLibrary *, DOSBase, 72, Dos)
  43.  
  44. /*  FUNCTION
  45.  
  46.     INPUTS
  47.  
  48.     RESULT
  49.  
  50.     NOTES
  51.  
  52.     EXAMPLE
  53.  
  54.     BUGS
  55.  
  56.     SEE ALSO
  57.  
  58.     INTERNALS
  59.  
  60.     HISTORY
  61.     29-10-95    digulla automatically created from
  62.                 dos_lib.fd and clib/dos_protos.h
  63.  
  64. *****************************************************************************/
  65. {
  66.     AROS_LIBFUNC_INIT
  67.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  68.  
  69.     /* Get pointer to filehandle */
  70.     struct FileHandle *fh=(struct FileHandle *)BADDR(lock);
  71.  
  72.     /* Get pointer to process structure */
  73.     struct Process *me=(struct Process *)FindTask(NULL);
  74.  
  75.     /* Get pointer to I/O request. Use stackspace for now. */
  76.     struct IOFileSys io,*iofs=&io;
  77.  
  78.     /* Prepare I/O request. */
  79.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  80.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  81.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  82.     iofs->IOFS.io_Device =fh->fh_Device;
  83.     iofs->IOFS.io_Unit     =fh->fh_Unit;
  84.     iofs->IOFS.io_Command=FSA_EXAMINE_ALL;
  85.     iofs->IOFS.io_Flags  =0;
  86.     iofs->io_Args[0]=(IPTR)buffer;
  87.     iofs->io_Args[1]=size;
  88.     iofs->io_Args[2]=data;
  89.  
  90.     /* Send the request. */
  91.     DoIO(&iofs->IOFS);
  92.  
  93.     /* Set error code and return */
  94.     if((me->pr_Result2=iofs->io_DosError)!=0)
  95.     {
  96.     control->eac_Entries=0;
  97.     return 0;
  98.     }
  99.  
  100.     for(size=1;buffer!=NULL;size++)
  101.     {
  102.     buffer->ed_Prot^=0xf;
  103.     buffer=buffer->ed_Next;
  104.     }
  105.     control->eac_Entries=size;
  106.  
  107.     return 1;
  108.     AROS_LIBFUNC_EXIT
  109. } /* ExAll */
  110.